#include<iostream>
#include<cstdio>
#define int long long
using namespace std;
int T,n,l,r,ans;
int a[1005];
int b[105];
int c[105];
bool deal(int x){
	int cnt=0; l=1;r=n;int j=0;
	while(x) b[++cnt]=x&1,x>>=1;
	for(int i=n;i>0;i--)
		if(!b[i]) c[++j]=a[l++];
		else c[++j]=a[r--];
//	for(int i=1;i<=n;i++)		cout<<c[i];
	int f=1;
	for(int j=1;j<=n/2;j++)
		if(c[j]!=c[n-j+1])f=0;
//	cout<<endl;
	return f;
}
void f(int x){int cnt=0,g=n;
	if(x==-1) cout<<-1;
	else {
		while(x) b[++cnt]=x&1,x>>=1;
		while(g) cout<<(b[g--]?'R':'L');
	}
	cout<<endl;
}
signed main(){
	freopen("palin.in","r",stdin);
	freopen("palin.out","w",stdout);
	cin>>T;
	while(T--){
		cin>>n; n*=2;
		for(int i=1;i<=n;i++)
			cin>>a[i];
		ans=-1;
		for(int i=0;i<(1<<(n));i++)
			if(deal(i)){
				ans=i; break;
			}
		f(ans);
	}
	return 0;
}
